package jamirr;

public final class AnnotationAttribute<T> implements Named {

    private final String name;
    private final T value;
    private final T defaultValue;
    private final String aliasFor;
    private final String aliasForAnnotation;

    AnnotationAttribute(String name, T value, T defaultValue, String aliasFor, String aliasForAnnotation) {
        this.name = name;
        this.value = value;
        this.defaultValue = defaultValue;
        this.aliasFor = aliasFor;
        this.aliasForAnnotation = aliasForAnnotation;
    }

    @Override
    public String getName() {
        return name;
    }

    public T getValue() {
        return value;
    }

    public T getDefaultValue() {
        return defaultValue;
    }

    public String getAliasFor() {
        return aliasFor;
    }

    public String getAliasForAnnotation() {
        return aliasForAnnotation;
    }

    public boolean hasValue() {
        return this.value != null;
    }

    public boolean isValid() {
        return this.value != null || this.defaultValue != null;
    }
}
